﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Core.Models
{
    public class CoreContext:DbContext
    {
        public CoreContext(DbContextOptions options)
            :base(options)
        {

        }

        public virtual DbSet<SysOrg> SysOrg { get; set; }
        public virtual DbSet<SysPerson> SysPerson { get; set; }
        public virtual DbSet<SysDictionaryType> SysDictionaryType { get; set; }
        public virtual DbSet<SysDictionary> SysDictionary { get; set; }
        public virtual DbSet<SysRole> SysRole { get; set; }
        public virtual DbSet<SysAction> SysAction { get; set; }


        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            //设置不跟踪所有查询  
            optionsBuilder.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking);

            base.OnConfiguring(optionsBuilder);
        }
    }
}
